/*
 * KelvinScale.hpp
 *
 * Copyright 2012 Pieter Agten
 *
 * This file is part of tltgen.
 *
 * tltgen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * tltgen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with tltgen.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file   KelvinScale.hpp
 * @author Pieter Agten (pieter.agten@gmail.com)
 * @date   11 oct 2012
 */


#ifndef KELVINSCALE_HPP
#define KELVINSCALE_HPP



#include <boost/serialization/base_object.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/export.hpp>

#include "SerializationException.hpp"
#include "TemperatureScale.hpp"

using boost::lexical_cast;

namespace tltgen {

  class KelvinScale : public TemperatureScale {
  public:
    virtual ~KelvinScale();
    virtual std::string getName() const;
    virtual std::string getShortUnitName() const;
    virtual Temperature fromKelvin(Temperature kelvin) const;
    virtual Temperature toKelvin(Temperature kelvin) const;

  private:
    friend class boost::serialization::access;
    template<class Archive> void serialize(Archive & ar, unsigned int version)
    {
      if (version != 0) {
        throw tltgen::SerializationException("Unknown version " + 
					     lexical_cast<std::string>(version) + " for KelvinScale.");
      }

      ar & boost::serialization::base_object<TemperatureScale>(*this);
    }
  };

}

BOOST_CLASS_VERSION(tltgen::KelvinScale, 0)
BOOST_CLASS_EXPORT_KEY(tltgen::KelvinScale)

#endif //KELVINSCALE_HPP
